<?php
	$xtpl_main->assign ( "page_title", "Register" );
	//--
	if(isset($_POST['frmAct']) && $_POST['frmAct'] == 'doRegister'){
		$result_chk = mysql_query("SELECT member_id FROM member WHERE member_username = '".addslashes($_POST['username'])."'");
		if(mysql_num_rows($result_chk) > 0){
			$xtpl->parse('center.blockFalse');
		}
		else{
			mysql_query("INSERT INTO member (member_username, member_password, member_address, member_mail, member_phone) 
			VALUES ('".addslashes($_POST['username'])."', '".md5($_POST['password'])."', '".addslashes($_POST['address'])."', '".addslashes($_POST['mail'])."', '".addslashes($_POST['phone'])."')");
			header('Location: index.php?mod=member&act=thankyou');
		}
	}
?>